Skip to content

fix(tier3): harden detached Gym cleanup against signals and inspection errors - #602

Merged
chrisknvidia merged 7 commits into
mainfrom
fix/christopherk/nemo-gym-detached-cleanup-signals
Nov 15, 2026
Merged

chrisknvidia merged 7 commits into
mainfrom
fix/christopherk/nemo-gym-detached-cleanup-signals

Conversation

@chrisknvidia

@chrisknvidia chrisknvidia commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Harden run-owned detached NeMo Gym cleanup after the startup-cleanup fix merged in #591.

BEFORE AFTER
SIGTERM/SIGHUP during detached teardown can terminate the evaluator before cleanup finishes. Defer those signals through detached teardown, restore handlers, then propagate cancellation.
Detached process-inspection failure can replace a pending KeyboardInterrupt. Preserve cancellation and retain the cleanup error as its cause and a failed-cleanup progress diagnostic.
A container PID 1 or subreaper can retain killed adopted servers as zombies. Perform bounded non-blocking waits only for previously identified run-owned detached PIDs.

Based on current main 0fbd41edbba1cfd13b566b11f04b172deb4887c1; no changes to the merged #591 branch were pushed after its merge.

Verification

Regression tests failed before the fixes: SIGTERM/SIGHUP terminated the cleanup subprocess with return codes -15/-1 before its completion marker; inspection failure replaced KeyboardInterrupt with GymCleanupError; a Linux subreaper retained its terminated adopted server until the test reaped it.

From this branch, with PYTHONPATH=src:

~/qual/wt-pr581/.venv/bin/python -m ruff check src/skillevaluator/tier3/nemo_gym/runner.py tests/test_nemo_gym_backend.py
All checks passed!
~/qual/wt-pr581/.venv/bin/python -m ruff format --check src/skillevaluator/tier3/nemo_gym/runner.py tests/test_nemo_gym_backend.py
2 files already formatted
~/qual/wt-pr581/.venv/bin/python -m pytest tests/test_nemo_gym_backend.py tests/test_nemo_gym_main_integration.py tests/cli/test_nemo_gym_autopilot_preflight.py -q
191 passed, 6 warnings in 72.69s (0:01:12)

The six warnings are existing Click deprecations. Evidence: ~/qual/artifacts/nemo-gym-detached-cleanup-signals.tests.txt.

No new provider-backed live evaluation or full-suite run was performed for this follow-up. Regression coverage includes real POSIX signal delivery and a real Linux subreaper; existing tests cover detached listening-server cleanup and unrelated-process preservation. No user-facing UI changed.

  • I am familiar with the Contributing Guidelines
  • Added or updated focused tests
  • Updated documentation for user-visible changes
  • Ran make lint
  • Ran make test
  • Ran make build
  • Did not add credentials, private datasets, or proprietary benchmark content

Release Impact

  • No user-visible release note needed
  • Updated CHANGELOG.md

🟢 Devin Review found nothing to fix · View findings · Follow Devin's work

Devin Review

Signed-off-by: Christopher Kevin <christopherk@nvidia.com>
Signed-off-by: Christopher Kevin <christopherk@nvidia.com>
Signed-off-by: Christopher Kevin <christopherk@nvidia.com>
Signed-off-by: Christopher Kevin <christopherk@nvidia.com>
Signed-off-by: Christopher Kevin <christopherk@nvidia.com>
Signed-off-by: Christopher Kevin <christopherk@nvidia.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

Signed-off-by: Christopher Kevin <christopherk@nvidia.com>
@chrisknvidia
chrisknvidia merged commit 78e3614 into main Nov 15, 2026
27 checks passed
@chrisknvidia
chrisknvidia deleted the fix/christopherk/nemo-gym-detached-cleanup-signals branch November 15, 2026 05:31
@NVIDIA NVIDIA deleted a comment from devin-ai-integration Bot Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant